package junior.util.mapstruct;

import java.util.Collection;
import java.util.List;

import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.MappingTarget;

/**
 * Name: BaseMapStruct
 * Function:
 *
 * @Author: K.K
 * Create Time: 2020/12/07 17:17
 * Modified By:
 * Modified Time:
 * Description:
 * Version:
 */
public interface BaseMapStruct<Source, Target> extends SimpleMapStruct<Source, Target> {

    /**
     * 逆映射
     *
     * @param source
     * @return
     */
    @InheritInverseConfiguration(name = "map")
    Source inverseMap(Target source);

    @InheritInverseConfiguration(name = "copy")
    void inverseCopy(Target source, @MappingTarget Source target);

    void mirrorCopy(Source source, @MappingTarget Source target);

    void inverseMirrorCopy(Target source, @MappingTarget Target target);

    List<Source> inverseMapList(Collection<Target> sources);
}
